package jp.co.hcs.attendancemanagement.inputtableb.logic.dto;

import java.util.ArrayList;
import java.util.List;

import jp.co.hcs.attendancemanagement.util.StringUtil;

/**
 * The Class ProjectEffortInfoDTO.
 */
public class ProjectEffortInfoDTO {

  /** The b add. */
  private boolean bAdd;

  /** The select. */
  private Boolean select;

  /** The seri. */
  private String seri;

  /** The old seri. */
  private String oldSeri;

  /** The actual effort year month. */
  private String actualEffortYearMonth;

  /** The actual effort date. */
  private String actualEffortDate;

  /** The project number. */
  private String projectNumber;

  /** The project code. */
  private String projectCode;

  /** The old project code. */
  private String oldProjectCode;

  /** The work code. */
  private String workCode;

  /** The old work code. */
  private String oldWorkCode;

  /** The work time. */
  private String workTime;

  /** The work name. */
  private String workName;

  /** The project name. */
  private String projectName;

  /** The employer code. */
  private String employerCode;

  /** The project change flag. */
  private boolean projectChangeFlag;

  /** The b disable. */
  private boolean bDisable;

  /** The work day dto list. */
  private List<WorkDayDTO> workDayDTOList = new ArrayList<WorkDayDTO>();

  /**
   * Gets the select.
   * 
   * @return the select
   */
  public Boolean getSelect() {
    return select;
  }

  /**
   * Sets the select.
   * 
   * @param select the new select
   */
  public void setSelect(Boolean select) {
    this.select = select;
  }

  /**
   * Gets the project code.
   * 
   * @return the project code
   */
  public String getProjectCode() {
    return projectCode;
  }

  /**
   * Sets the project code.
   * 
   * @param projectCode the new project code
   */
  public void setProjectCode(String projectCode) {
    // if(this.projectCode != null)
    // {
    // if(!this.projectCode.equals(projectCode))
    // {
    // projectChangeFlag = true;
    // }
    // }
    if (projectCode == null) {
      this.projectCode = new String();
    } else {
      this.projectCode = projectCode;
    }

  }

  /**
   * Gets the project name.
   * 
   * @return the project name
   */
  public String getProjectName() {
    return projectName;
  }

  /**
   * Sets the project name.
   * 
   * @param projectName the new project name
   */
  public void setProjectName(String projectName) {
    this.projectName = projectName;
  }

  /**
   * Gets the actual effort year month.
   * 
   * @return the actual effort year month
   */
  public String getActualEffortYearMonth() {
    return actualEffortYearMonth;
  }

  /**
   * Sets the actual effort year month.
   * 
   * @param actualEffortYearMonth the new actual effort year month
   */
  public void setActualEffortYearMonth(String actualEffortYearMonth) {
    this.actualEffortYearMonth = actualEffortYearMonth;
  }

  /**
   * Gets the actual effort date.
   * 
   * @return the actual effort date
   */
  public String getActualEffortDate() {
    return actualEffortDate;
  }

  /**
   * Sets the actual effort date.
   * 
   * @param actualEffortDate the new actual effort date
   */
  public void setActualEffortDate(String actualEffortDate) {
    // if(this.actualEffortDate != null)
    // {
    // if(!this.actualEffortDate.equals(actualEffortDate))
    // {
    // projectChangeFlag = true;
    // }
    // }
    this.actualEffortDate = actualEffortDate;
  }

  /**
   * Gets the project number.
   * 
   * @return the project number
   */
  public String getProjectNumber() {
    return projectNumber;
  }

  /**
   * Sets the project number.
   * 
   * @param projectNumber the new project number
   */
  public void setProjectNumber(String projectNumber) {
    // if(this.projectNumber != null)
    // {
    // if(!this.projectNumber.equals(projectNumber))
    // {
    // projectChangeFlag = true;
    // }
    // }
    if (projectNumber == null) {
      this.projectNumber = new String();
    }
    this.projectNumber = projectNumber;
  }

  /**
   * Gets the work code.
   * 
   * @return the work code
   */
  public String getWorkCode() {
    return workCode;
  }

  /**
   * Sets the work code.
   * 
   * @param workCode the new work code
   */
  public void setWorkCode(String workCode) {
    // if(this.workCode != null)
    // {
    // if(!this.workCode.equals(workCode))
    // {
    // projectChangeFlag = true;
    // }
    // }
    if (workCode == null) {
      this.workCode = new String();
    } else {

    }
    this.workCode = workCode;
  }

  /**
   * Gets the work time.
   * 
   * @return the work time
   */
  public String getWorkTime() {
    return workTime;
  }

  /**
   * Sets the work time.
   * 
   * @param workTime the new work time
   */
  public void setWorkTime(String workTime) {
    if (workTime.indexOf(":") == -1) {
      this.workTime = StringUtil.convertStringTotalTimetoDisplayFormat(workTime);
    } else {
      this.workTime = workTime;
    }
  }

  /**
   * Gets the work name.
   * 
   * @return the work name
   */
  public String getWorkName() {
    return workName;
  }

  /**
   * Sets the work name.
   * 
   * @param workName the new work name
   */
  public void setWorkName(String workName) {
    // if(this.workName != null)
    // {
    // if(!this.workName.equals(workName))
    // {
    // projectChangeFlag = true;
    // }
    // }
    this.workName = workName;
  }

  /**
   * Gets the work day dto list.
   * 
   * @return the work day dto list
   */
  public List<WorkDayDTO> getWorkDayDTOList() {
    return workDayDTOList;
  }

  /**
   * Sets the work day dto list.
   * 
   * @param workDayDTOList the new work day dto list
   */
  public void setWorkDayDTOList(List<WorkDayDTO> workDayDTOList) {
    this.workDayDTOList = workDayDTOList;
  }

  /**
   * Sets the project effort info dto list.
   * 
   * @param index the index
   * @param workDayDTOObj the work day dto obj
   */
  public void setProjectEffortInfoDTOList(int index, WorkDayDTO workDayDTOObj) {
    workDayDTOList.set(index, workDayDTOObj);
  }

  /**
   * Gets the work day dto list.
   * 
   * @param i the i
   * @return the work day dto list
   */
  public WorkDayDTO getWorkDayDTOList(int i) {
    int listObjSize = workDayDTOList.size();
    // check if object exists at specified index
    if ((i + 1) > listObjSize) {
      // add objects
      for (int j = listObjSize; j < i + 1; j++) {
        WorkDayDTO beanObj = new WorkDayDTO();
        workDayDTOList.add(j, beanObj);
      }
    }
    // get and return object at this index
    return (WorkDayDTO) workDayDTOList.get(i);
  }

  /**
   * Gets the employer code.
   * 
   * @return the employer code
   */
  public String getEmployerCode() {
    return employerCode;
  }

  /**
   * Sets the employer code.
   * 
   * @param employerCode the new employer code
   */
  public void setEmployerCode(String employerCode) {
    this.employerCode = employerCode;
  }

  /**
   * Checks if is b changed.
   * 
   * @return true, if is b changed
   */
  public boolean isbChanged() {
    return projectChangeFlag;
  }

  /**
   * Sets the b changed.
   * 
   * @param bChanged the new b changed
   */
  public void setbChanged(boolean bChanged) {
    this.projectChangeFlag = bChanged;
  }

  /**
   * Checks if is b add.
   * 
   * @return true, if is b add
   */
  public boolean isbAdd() {
    return bAdd;
  }

  /**
   * Sets the b add.
   * 
   * @param bAdd the new b add
   */
  public void setbAdd(boolean bAdd) {
    this.bAdd = bAdd;
  }

  /**
   * Checks if is b disable.
   * 
   * @return true, if is b disable
   */
  public boolean isbDisable() {
    return bDisable;
  }

  /**
   * Sets the b disable.
   * 
   * @param bDisable the new b disable
   */
  public void setbDisable(boolean bDisable) {
    this.bDisable = bDisable;
  }

  /**
   * Gets the old project code.
   * 
   * @return the old project code
   */
  public String getOldProjectCode() {
    return oldProjectCode;
  }

  /**
   * Sets the old project code.
   * 
   * @param oldProjectCode the new old project code
   */
  public void setOldProjectCode(String oldProjectCode) {
    this.oldProjectCode = oldProjectCode;
  }

  /**
   * Gets the old work code.
   * 
   * @return the old work code
   */
  public String getOldWorkCode() {
    return oldWorkCode;
  }

  /**
   * Sets the old work code.
   * 
   * @param oldWorkCode the new old work code
   */
  public void setOldWorkCode(String oldWorkCode) {
    this.oldWorkCode = oldWorkCode;
  }

  /**
   * Gets the old seri.
   * 
   * @return the old seri
   */
  public String getOldSeri() {
    return oldSeri;
  }

  /**
   * Sets the old seri.
   * 
   * @param oldSeri the new old seri
   */
  public void setOldSeri(String oldSeri) {
    if (oldSeri == null) {
      this.oldSeri = new String();
    } else {
      this.oldSeri = oldSeri;
    }
  }

  /**
   * Sets the seri.
   * 
   * @param seri the new seri
   */
  public void setSeri(String seri) {
    if (oldSeri == null) {
      this.seri = new String();
    } else {
      this.seri = seri;
    }
  }

  /**
   * Gets the seri.
   * 
   * @return the seri
   */
  public String getSeri() {
    return seri;
  }

  /**
   * Sets the seri by project number.
   */
  public void setSeriByProjectNumber() {
    if (projectNumber != null) {
      this.seri = projectNumber.substring(projectNumber.length() - 2, projectNumber.length());
    }
  }
}
